﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ColumnNewList.aspx.cs" Inherits="Whir_System_Module_Role_ColumnNewList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

    <script language="javascript" type="text/javascript">
        if (top.location == self.location) { 
            alert('禁止访问子栏目页！将跳转到默认页面');
            top.location='../../Default.aspx';
        } 
    </script>
    <link href="../../Skin/Default/Css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../Skin/Default/Css/openWindow.css" rel="stylesheet" type="text/css" />
    <link href="../../Js/Jquery/thickbox3/thickbox.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="../../Js/Jquery/jquery.js"></script>
    <script type="text/javascript" src="../../Js/Jquery/jquery.ui.js"></script>
    <script type="text/javascript" src="../../Js/Jquery/thickbox3/thickbox.js"></script>
    <!-- BEGIN Plugin Code -->
    <link href="../../Js/Jquery/treeTable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Js/Jquery/treeTable/javascripts/jquery.treeTable.js"></script>
    <script type="text/javascript">
        $(document).ready(function()  {
                            
            //$("#dnd-example").treeTable();
            
            $("#columnTable").treeTable();
            
            //senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
            senfe("columnTable","#fff","#fff","#d5e3ef","#fff");
            
            var colIDs = '<%= colIDs %>';   //获取所有父编号
            //迭代所有父编号打开所有的节点
            for (var i = (colIDs.split(',').length -1); i >= 0; i--) {
                if (colIDs.split(',')[i] != "") {
                    $("#columnTable #node-" + colIDs.split(',')[i] + "").expand();
                }
            }
        });
          
    </script>
    <!--提示文字-->
    <script src="../../Js/common.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        //showhint('0','<b>如何修改栏目</b><br/>在下面菜单中，右键选择您需要修改的栏目节点，点击“编辑此栏目”进行下一步操作。<br/><b>如何删除栏目</b><br/>在下面菜单中，右键选择您需要修改的栏目节点，点击“删除此栏目”进行下一步操作。');
    </script>
    <style type="text/css">
    html { 
        overflow-x:hidden; /*隐藏水平滚动条*/ 
    } 
    
    
    /* TABLE
     * ========================================================================= */
    .columnTable {
      border: 1px solid #888;
      border-collapse: collapse;
      line-height: 1;
      margin: 1em auto;
      width: 100%;
    }

    /* Caption
     * ------------------------------------------------------------------------- */
    .columnTable caption {
      font-size: .9em;
      font-weight: bold;
    }

    /* Header
     * ------------------------------------------------------------------------- */
    .columnTable thead {
      background: #aaa url(../images/bg-table-thead.png) repeat-x top left;
      font-size: .9em;      
    }

    .columnTable thead tr th {
      border: 1px solid #888;
      font-weight: normal;
      padding: .3em 1.67em .1em 1.67em;
      text-align: left;
      height:25px;
      font-weight: bold;                 
    }

    /* Body
     * ------------------------------------------------------------------------- */
    .columnTable tbody tr td {
      cursor: default;
      padding: .3em 1.5em;
    }

    .columnTable tbody tr.even {
      background: #f3f3f3;
    }

    .columnTable tbody tr.odd {
      background: #fff;
    }

    .columnTable span {
      background-position: center left;
      background-repeat: no-repeat;
      padding: .2em 0 .2em 1.5em;
    }

    .columnTable span.file {
      background-image: url(../images/page_white_text.png);
    }

    .columnTable span.folder {
      background-image: url(../../Js/Jquery/treeTable/images/folder.gif);
      cursor:hand;
    }
    
    #senfe {
	width: 300px;
	border-top: #000 1px solid;
	border-left: #000 1px solid;
    }
    #senfe td {
	    border-right: #000 1px solid;
	    border-bottom: #000 1px solid;
    }

    </style>
    <script language="javascript" type="text/javascript">
    <!--
    function senfe(o,a,b,c,d){
	    var t=document.getElementById(o).getElementsByTagName("tr");
	    for(var i=0;i<t.length;i++){
		    t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b;
		    t[i].onclick=function(){
			    if(this.x!="1"){
				    this.x="1";//本来打算直接用背景色判断，FF获取到的背景是RGB值，不好判断
				    this.style.backgroundColor=d;
			    }else{
				    this.x="0";
				    this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
			    }
		    }
		    t[i].onmouseover=function(){
			    if(this.x!="1")this.style.backgroundColor=c;
		    }
		    t[i].onmouseout=function(){
			    if(this.x!="1")this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
		    }
	    }
    }
    //排序
    function ChangeColumnSotr(columnID, operator, changeID) {
        var url = "../../UserControls/Common/ChangeColumnSotr.ashx?ID=" + columnID + "&action=" + escape(operator) + "&CID=" + changeID;
        $.getScript(url,function() {
	        if (typeof(data) != undefined) {
		        if (data)
			        location.href = "ColumnNewList.aspx?ID=" + columnID;
		        else
			        alert("移动失败！");
	        }
        });
    }
    
    //确认删除
    function ConFirm(columnID) {
        if (confirm("确定要删除该栏目吗?")) {
            location.href = "AddColumn.aspx?Action=Delete&ColumnID=" + columnID;
        }
    }
    //保存菜单
    function dropClick(columnID) {
        var modelFormID = $("#select" + columnID).val();
        var url = "../../UserControls/Common/SaveColumnForm.ashx?ID=" + columnID + "&modelFormID=" + modelFormID;
        $.getScript(url, function() {
            if (typeof(data) != undefined) {
                if (data)
                    location.href = "ColumnNewList.aspx?ID=" + columnID + "&op=modify";
                else
			        alert("保存失败,请与管理员联系！");
            }
        });
    }
    //显示保存
    function ShowAndHidden(columnID, formID) {
        $("#show" + columnID).toggle();
        $("#hidden" + columnID).fadeIn("slow");
        $("#select" + columnID).val(formID);
    }
    //取消
    function Cancel(columnID) {
        $("#hidden" + columnID).toggle();
        $("#show" + columnID).fadeIn("slow");
    }
    -->
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <table align="center" width="100%">
            <tr>
                <td colspan="2">
                    &nbsp;&nbsp;<a href="AddColumn.aspx?Action=Add&placeValuesBeforeTB_=savedValues&TB_iframe=true&height=400&width=550&modal=true" class="thickbox">添加栏目</a> 
                    &nbsp; <a href="AddColumn3.aspx?Action=Add&placeValuesBeforeTB_=savedValues&TB_iframe=true&height=400&width=550&modal=true" class="thickbox">快速添加</a> 
                    &nbsp; <a href="../Template/Main.aspx">快速匹配</a> 
                    &nbsp;<input type="button" id="Button5" runat="server" class="btn_default" value="发布栏目" onclick="location='../Publish/PublishManage.aspx'" />&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <table id="columnTable" align="center" width="100%" class="columnTable">
                        <thead>
                            <tr height="20px" class="grid_Title">
                                <td width="30%">
                                    &nbsp;&nbsp;&nbsp;&nbsp;栏目名称</td>
                                <td width="40%">
                                    &nbsp;&nbsp;&nbsp;&nbsp;功能表单</td>
                                <td width="10%" align="center">
                                    排序</td>
                                <td width="20%">
                                    &nbsp;</td>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                        </tbody>
                    </table>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
